#include<bits/stdc++.h>
using namespace std;
int n;
bool flag=0;
int ans=0;
bool done[100010],ex[100010];
int a[100010];
int num[100010];
int main(){

    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);

    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        num[a[i]]++;
        if(a[i]>2)flag=1;
    }
    //cout<<num[1]<<" "<<num[2]<<endl;
    if(flag==0){
        if(num[1]<num[2])cout<<num[2];
        else cout<<num[1];
        return 0;
    }
    sort(a+1,a+n+1);
   // cout<<a[1]<<" "<<a[2]<<endl;
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            if(a[j]>a[i]&&done[j]==0){
                done[j]=1;
                ex[i]=1;
                //cout<<i<<" "<<j<<endl;
                break;
            }
        }

    }
    for(int i=1;i<=n;i++){
        if(ex[i]==0)ans++;
    }
    cout<<ans;

    fclose(stdin);
    fclose(stdout);

return 0;
}
/*
5
1 2 3 1 2
*/
